package com.clip.util.mail;

import java.io.InputStream;
import java.util.Properties;

public class Env extends Properties{
	private static Env instance;
	private Env(){
		InputStream is = this.getClass().getResourceAsStream("/MailInfo.props");
		try{
			this.load(is);
		}catch(Exception e){
			System.err.println("读取属性文件是遇到错误！");
			e.printStackTrace();
		}
	}
	private static synchronized void makeInstance(){
		if(instance == null){
			instance = new Env();
		}
	}
	public static Env getInstance(){
		if(instance != null){
			//实例已被创建时将直接返回当前实例
			return instance;
		}else{
			//实例还没有被创建则新建properties实例对象
			makeInstance();
			return instance;
		}
	}
}
